const mongoose = require("./db.js");

var ArticleSchema = mongoose.Schema({
    uid: String,//用户uid
    uname: String,//用户昵称
    a_id: String,//文章编号uid+firstTitle
    a_type: Boolean, //(0未发布 1发布)
    fileName: String,//放入的文件夹的名称
    title: String, //文章名称
    intr: String, //(简介)
    addTime: Date,//最后提交时间
    mark: Array, //(小说、社会、教育、科技、美食、艺术)
    content: String,//(正文)
    coverImg: String,//封面图片
    viewCount: Number,//(浏览次数)
    likeCount: Array,//(点赞次数)
    collectionCount: Array,//(收藏次数)
    comment: [{//(评论)
        c_id: String,
        c_name: String,
        c_imgHead: String,
        c_addTime: String,
        c_content: String,
        c_likes: Array,
        c_type: Boolean,
    }]
});

module.exports = mongoose.model('Article', ArticleSchema, 'article');